package com.ailink.basic.reflect;

import java.lang.reflect.Method;

/**
 * Created by Administrator on 2018/8/6
 */
public class ClassUtils {
    public static void printClassMessage(Object o) {
        Class c = o.getClass();
        System.out.println("类的名称是："  + c.getName());
        Method[] methods = c.getMethods();
//        c.getDeclaredMethods();
        for (int i = 0; i < methods.length; i++) {
            Class returnType = methods[i].getReturnType();
            System.out.println(returnType.getName());
            System.out.println(methods[i].getName());
            Class[] paramTypes = methods[i].getParameterTypes();
            for (Class class1 : paramTypes) {
                System.out.println(class1.getName());
            }
        }
    }
}
